package com.sinosoft.tcmneim.controller;

import com.sinosoft.tcmneim.dataObject.TblDiatrmentLargeipment;
import com.sinosoft.tcmneim.dataObject.TblHrPersosittion;
import com.sinosoft.tcmneim.service.TblHrPersosittionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 人力资源-目前本医疗机构各级各类人员情况 Controller
 *
 * @author bjc
 * @date 2021-09-15
 */
@Controller
@RequestMapping("/tblHrPersosittion")
public class TblHrPersosittionController {

    @Autowired
    TblHrPersosittionService tblHrPersosittionService;
    /**
     * 查询人力资源-目前本医疗机构各级各类人员情况
     */
    @GetMapping("/list")
    @ResponseBody
    public List<TblHrPersosittion> list(){
        List<TblHrPersosittion>list=tblHrPersosittionService.list();
        return list ;
    }
    /**
     * 根据ID查询人力资源-目前本医疗机构各级各类人员情况
     */
    @GetMapping("/selectByItemCode/{itemCode}")
    @ResponseBody
    public Object selectByItemCode(@PathVariable("itemCode")String itemCode){
        return tblHrPersosittionService.selectByItemCode(itemCode);
    }
    /**
     * 新增人力资源-目前本医疗机构各级各类人员情况
     */
    @PostMapping("/save")
    public int save(TblHrPersosittion tblHrPersosittion){
        return tblHrPersosittionService.insert(tblHrPersosittion);
    }

    /**
     * 修改人力资源-目前本医疗机构各级各类人员情况
     */
    @PostMapping("/updated")
    public int updated(TblHrPersosittion tblHrPersosittion){
        return tblHrPersosittionService.updated(tblHrPersosittion);
    }
    /**
     * 删除人力资源-目前本医疗机构各级各类人员情况
     */
    @PostMapping( "/remove")
    public int remove(String  itemCode)
    {
        return tblHrPersosittionService.deleteByItemCode(itemCode);
    }
}
